% Lucia Wagner and Sara Clifton- September 2021
% code to generate Figure 7

x=2022:2028; % span of years for ecig tipping point sensitivity analysis

% values obtained from model code output ('LW_adult/youth_fit_ACEmodel),
% code is annotated where values are derived
y1=[0.053 0.078 0.083 0.086 0.074 0.080 0.083]; % adult maximum peak prevalence
y2=[0.32 0.39 0.48 0.52 0.59 0.65 0.71]; % adolescent maximum peak prevalence
y3=[0.94 1.1 1.2 1.2 1.2 1.1 1.2]; % adult public health ratio
y4=[2.5 3.2 4.7 4.8 5.9 6.7 7.4]; % adolescent public health ratio

% generate figure
t=tiledlayout(2,2);
p1=nexttile;
plot(x,y1,'LineWidth',3)
title(p1,'Adult')
ylabel(p1,'Maximum vaping prevalence',"FontSize",14)
set(gca,'XTickLabel',[])
ylim([0 1])
p2=nexttile;
plot(x,y2,'LineWidth',3)
title(p2,'Youth')
set(gca,'XTickLabel',[],'YTickLabel',[])
ylim([0 1])
p3=nexttile;
plot(x,y3,'r','LineWidth',3)
ylabel(p3,'Public health ratio (r) in 2030','FontSize',14)
ylim([0 10])
p4=nexttile;
plot(x,y4,'r','LineWidth',3)
ylim([0 10])
set(gca,'YTickLabel',[])
t.Padding = 'compact';
t.TileSpacing = 'compact';
linkaxes([p1,p2,p3,p4],'x');
xlabel(t,'Vaping utility inflection year {\it(T_{E})}','FontSize',14)